﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_
{
    public partial class Form1 : Form     

    {

        public int a = 0;

 


        public Form1()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-Hans");
            InitializeComponent();
        }

        private void onf_Click(object sender, EventArgs e)
        {
            Form2 form2 = new Form2();
            form2.Show();
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void cl_Click(object sender, EventArgs e)
        {
            if(a==0)
            {
                ChangeLanguage("zh-hans");
                a=1;
            }

            else
            {
                ChangeLanguage("en");
                a=0;
            }

        }

        private void cc1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void cb_Click(object sender, EventArgs e)
        {
            this.Icon = new Icon(@"C:\GRDICT\IDE\week2\Assignment2\IDE_week2_Forms_\Resources\Icon1.ico");
        }

        private void ri_Click(object sender, EventArgs e)
        {
            this.Icon = new Icon(@"C:\GRDICT\IDE\week2\Assignment2\IDE_week2_Forms_\Resources\form.ico");
        }

        


    }
}
